package com.zerous.staria.screens;
import android.os.*;
import com.zerous.framework.*;
import com.zerous.framework.ui.*;
import com.zerous.staria.*;

public class MainScreen extends Screen
{
	Button toGame, toSettings;
	public MainScreen(Game g, Screen parent)
	{
		super(g, parent);
		toGame = new Button(Zex.Const.width/2 - 150, Zex.Const.height/2 - 75, 300, 150);
		toGame.setOnClick(new UIBase.OnClick() { public void click() {
			MainScreen.this.game.setScreen(new GScreen(game, MainScreen.this)); 
			/*Message m = game.getGameHandler().obtainMessage();
			Bundle b = new Bundle();
			b.putString("eq", "open");
			m.setData(b);
			game.getGameHandler().sendMessage(m);*/
			//Util.toast(game, "施工中");
			/*synchronized(this)
			{
				Toast.makeText(game, "Hello", Toast.LENGTH_SHORT).show();
			}*/
		}});
		toSettings = new Button(Zex.Const.width - 220, Zex.Const.height -220, 200, 200);
		toSettings.setOnClick(new UIBase.OnClick() { public void click() {
			MainScreen.this.game.setScreen(new TestScreen(game, MainScreen.this, Res.testLayout));
		}});
	}

	@Override
	public void update()
	{
		toGame.update();
		toSettings.update();
	}

	@Override
	public void render()
	{
		Zex.graphics.clear(0xff001966);
		Zex.graphics.drawPixmap(Images.LOGO, Zex.Const.width/2 - Images.LOGO.getWidth()/2, 0, 255);
		toGame.draw();
		toSettings.draw();
	}
}
